const { defineConfig } = require('@vue/cli-service')

module.exports = defineConfig({
  transpileDependencies: true,
  lintOnSave: true,
  pluginOptions: {
    'style-resources-loader': {
      preProcessor: 'less',
      patterns: []
    }
  },
  outputDir: process.env.OUT_PUT_DIR,
  devServer: {
    port: 888,
    compress: true,
    proxy: {
      [process.env.VUE_APP_API_URL]: { // 拦截器( 拦截 链接中 有process.env.VUE_APP_API )
        target: process.env.VUE_API_DEV_TARGET, // nginx服务器地址,或者已备案的域名
        pathRewrite: {
          [`^/${process.env.VUE_APP_API_URL}`]: ''
        },
        changeOrigin: true,
        ws: true
      }
    }
  }
})
